package com.wuzuqing.android.eightdiagrams

import android.annotation.SuppressLint
import android.widget.TextView
import com.wuzuqing.android.eightdiagrams.base.BaseAdapter
import com.wuzuqing.android.eightdiagrams.base.BaseViewHolder
import com.wuzuqing.android.eightdiagrams.dao.BaZhiHistory
import com.wuzuqing.android.eightdiagrams.term.ExactDate
import com.wuzuqing.android.eightdiagrams.term.Solar
import java.util.*

/**
 * @CopyRight: 广州仰望星空云科技有限公司
 * @Author : wuzuqing
 * @Email:wuzuqing@xinyu668.com
 * @CreateTime: 12.12.23 3:44 PM
 * @Description: 请写描述
 */


class BaZhiHistoryAdapter:BaseAdapter<BaZhiHistory>(R.layout.item_result) {
    @SuppressLint("SetTextI18n")
    override fun onBindViewHolder(holder: BaseViewHolder, position: Int) {
        getItem(position)?.apply {
            holder.itemView.setPadding(0,30,0,30)
            val solar = Solar.fromDate(ExactDate.fromTimeInMillis(createTime))
            holder.getView<TextView>(R.id.text1).text  ="${nickName}:${city}:${solar.toYmdHms()}"
        }
    }
}